import React from 'react';
import CommonList from '../../../../components/CommonLists/list';
import { Button } from 'antd';

class TacticsEventList extends CommonList {
  constructor(props) {
    super(props);
    this.api = 'indexDataSource';
    this.tableParams = {
      rowKey: 'event_id'
    };
    this.operatorWidth = 150;
    this.editButton = record => {
      return (
        <Button
          size='small'
          type='link'
          onClick={this.edit.bind(this, record, { title: '编辑' })}
          disabled={record.audit_status === this.AUDIT._WAIT}
        >
          编辑
        </Button>
      );
    };
    this.delButton = record => {
      return (
        <Button
          size='small'
          type='link'
          onClick={this.delete.bind(this, record)}
          disabled={record.audit_status === this.AUDIT._WAIT}
        >
          删除
        </Button>
      );
    };
    this.btnGroup = [this.editButton, this.delButton];
  }
  componentDidMount() { }

  // 删除时的参数
  getDeleteParam = record => {
    return { id: record.data_source_id };
  };
}

export default TacticsEventList;
